package com.ticket.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ticket.entity.VenueSection;
import com.ticket.mapper.VenueSectionMapper;
import com.ticket.service.IVenueSectionService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VenueSectionServiceImpl extends ServiceImpl<VenueSectionMapper, VenueSection> implements IVenueSectionService {
    
    @Override
    public List<VenueSection> getSectionsByVenueId(Long venueId) {
        LambdaQueryWrapper<VenueSection> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(VenueSection::getVenueId, venueId);
        return this.list(queryWrapper);
    }
    
    @Override
    public Integer getSectionCapacity(Long sectionId) {
        VenueSection section = this.getById(sectionId);
        return section != null ? section.getCapacity() : null;
    }
} 